<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>后台管理面板</title>
    <!-- 告诉浏览器该页面是自适应布局 -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    {include file="common/top" /}
</head>
<body class="hold-transition skin-blue sidebar-mini">
<div class="wrapper">
    <div class="content-wrapper" style="margin-left: 0 !important;">
        <!--页眉-->
        <section class="content-header">
            <h1>轮播图列表</h1>
        </section>
        <!--内容开始-->
        <section class="content">
            <div class="search">
                <form class="form-inline" action="{:url('admin/banner/index')}">
<!--                    <input type="text" class="form-control" name="keyword" placeholder="文章标题" value="{$keyword}">-->
<!--                    <input type="text" class="form-control" name="dateran" autocomplete="off" placeholder="选择日期" value="{$dateran}">-->
<!--                    <input class="btn btn-flat btn-primary" type="submit" value="搜索">-->
<!--                    <input class="btn btn-flat btn-primary m_10" onclick="location.href='{:url(\'admin/customer/index\')}'" type="button" value="显示全部">-->
                    <input class="btn btn-flat btn-warning m_10 select_del" type="button" value="批量删除">
                    <!-- <a class="btn btn-flat btn-primary" data-toggle="modal" data-target="#apply-edit"  href="javascript:void (0)" value="批量下载订单">批量下载订单</a> -->
                    <!--{:url('admin/order/allDown')}-->
                </form>
            </div>
            <!--数据表开始-->
            <div class="row">
                <div class="col-xs-12">
                    <div class="box">
                        <div class="box-header">
                            <!-- /.box-header -->
                            <div class="box-body table-responsive no-padding">
                                <table class="table table-bordered table-hover">
                                    <tr>
                                        <th class="t_c"><input type="checkbox" id="check"></th>
                                        <th class="t_c">编号</th>
                                        <th class="t_c">图片</th>

                                        <th class="t_c">排序</th>
                                        <th class="t_c">添加时间</th>
                                        <th class="t_c">操作</th>
                                    </tr>
                                    {volist name='list' id='list' empty="$empty"}
                                    <tr><td class="t_c"><input type="checkbox" name="key[]" value="{$list.id}"></td>
                                        <td class="t_c">{$list.id}</td>
                                        
                                        <td class="t_c"><img src="{$list.img}" style="height: 80px;" alt=""></td>

                                        <td class="t_c">{$list.sort}</td>
                                        <th class="t_c">{$list.create_time|date="Y-m-d H:i:s"}</th>
                                        <!-- <th class="t_c"></th> -->
                                        <td class="t_c">
                                            <a class="btn btn-flat btn-danger btn-xs" href="{:url('admin/banner/edit',['id'=>$list.id])}">
                                                <i class="fa fa-edit"></i> 编辑轮播图
                                            </a>
                                            <a class="btn btn-flat btn-warning btn-xs list_del" data-id="{$list.id}">
                                                <i class="fa fa-trash-o"></i> 删除
                                            </a>
                                        </td>
                                    </tr>
                                    {/volist}
                                </table>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer clearfix page">
                                {$page|raw}
                                <!---->
                                {$pageSize|raw}
                                <!---->
                            </div>
                        </div>
                        <!-- /.box -->
                    </div>
                </div>
                <!--数据表结束-->
        </section>
        <!-- right col -->
    </div>
    <!-- /.row (main row) -->

    </section>
    <!--内容结束-->
</div>
</div>

{include file="common/bottom" /}
<script src="/static/lib/layer/layer.js"></script>

<script>
    //排序
    $(".changeSort").blur(function(){
        var url = "{:url('sort')}";
        var id = $(this).data("id");
        var sort = $(this).val();
        changeSort(url,id,sort);
    });

    //设置状态
    $(".state").click(function(){
        var url = "{:url('state')}";
        var id = $(this).data("id");
        changeState(url,id);
    });

    //删除
    $(".list_del").click(function(){
        var url = "{:url('admin/banner/del')}";
        var id = $(this).data("id");
        delOne(url,id)
    })

    //批量删除
    $(".select_del").click(function(){
        var url = "{:url('admin/banner/selectDel')}";
        delSelect(url);
    })
    //显示数量
    $(".page_size").change(function() {
        var page_size = $(this).val();
        var url = "{:url('admin/banner/index',['keyword'=>$keyword,'page_size'=>'pagesize'])}";
        url =  url.replace("pagesize",page_size);
        window.location.replace(url);
    });
</script>
</body>
</html>